#include "client.h"
int recvcycle(int newfd,void *pstart,int len)
{
    char *p=(char*)pstart;
    int total=0,ret;
    while(total<len)
    {
        ret=recv(newfd,p+total,len-total,0);
        if(0==ret)//对端断开
        {
            sleep(1);
            printf("Something wrong happened!\n");
            //return -1;
        }
        total+=ret;
    }
    return 0;
}

